package indi.entity;

import java.io.Serializable;
import java.sql.Time;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;

import indi.service.*;

//借书记录
public class Record{
	//数据库自动生成ID
	private String ID;
	//归还标识
	private int isReturn;
	//借出时间
	private Date borrowTime;
	//应还时间
	private Date dueTime;
	//关联借阅证
	private String cardID;
	//当前关联书本的国际号
	private String ISBN;
	//当前关联书籍的图书号
	private String idOfLibrary;
	//实际归还时间
	private Date returnTime;
	
	// 构造不需要Record部分属性，自己生成
//	public Record(String ID, int isReturn, 
//			Date borrowTime, Date dueTime, 
//			String cardID, String ISBN, 
//			Date returnTime) {
//		this.ID = ID;
//		this.isReturn = isReturn;
//		this.borrowTime = borrowTime;
//		this.dueTime = dueTime;
//		this.cardID = cardID;
//		this.ISBN = ISBN;
//		this.returnTime = returnTime;
//	}
	// 采用此构造方法
	public Record(String cardID, String isbn) {
		this.cardID = cardID;
		this.ISBN = isbn;
		this.borrowTime = new java.util.Date();
		// 计算DueTime
		//this.dueTime = getDueTimme();
	}
	
	public String toString() {
		return ID + "|" + isReturn  + "|" + borrowTime.toString()
				  + "|" + ISBN + "|" + cardID;
	}
	
	public String getID() {
		return ID;
	}
	
	public Date getBorrowTime() {
		return this.borrowTime;
	}
	/**
	 * @return the iSBN
	 */
	public String getISBN() {
		return ISBN;
	}
	
	public String getCardID() {
		return cardID;
	}
	
	
}
